<?php $event = current($pager->getResults()) ?>

<div class="ajax_box">
  <h1><?php echo 'Eventos - '.$day.'/'.$month.'/'.$year ?></h1>
  <div class="content">
    <h2><?php echo $event->getDescription() ?></h2><br/>
    <h2>Categoria: </h2>
    <?php echo $event->getBolaoCategory()->getName() ?>
    <?php
      if ($event->hasBolaoSubcategory())
        echo ' ('.$event->getBolaoSubcategory()->getName().')';
    ?>
    <br/>
    <h2>Local: </h2><?php echo $event->getLocation() ?><br/>
    <h2>In&iacute;cio: </h2>
    <?php
       echo $event->getStartDate('d/m/Y');
       if ($event->getStartTime('Hi') > 0)
         echo ' '.$event->getStartTime('H:i');
    ?>
  <?php if ($event->hasEndDate()) : ?>
    <h2>T&eacute;rmino: </h2>
    <?php
       echo $event->getEndDate('d/m/Y');
       if ($event->getEndTime('Hi') > 0)
         echo ' '.$event->getEndTime('H:i');
    ?>
  <?php endif; ?>

  <?php if ($pager->haveToPaginate()): ?>
    <div class="pagination">
      <a class="ajaxLink" href="<?php echo url_for('event/index?day='.$day.'&month='.$month.'&year='.$year.'&page=1') ?>">
        <img src="/images/first.png" alt="Primeira p&aacute;gina" title="Primeira p&aacute;gina" />
      </a>
 
      <a class="ajaxLink" href="<?php echo url_for('event/index?day='.$day.'&month='.$month.'&year='.$year.'&page='.$pager->getPreviousPage()) ?>">
        <img src="/images/previous.png" alt="P&aacute;gina anterior" title="P&aacute;gina anterior" />
      </a>
 
      <?php foreach ($pager->getLinks() as $page): ?>
        <?php if ($page == $pager->getPage()): ?>
          <?php echo $page ?>
        <?php else: ?>
          <a class="ajaxLink" href="<?php echo url_for('event/index?day='.$day.'&month='.$month.'&year='.$year.'&page='.$page) ?>"><?php echo $page ?></a>
        <?php endif; ?>
      <?php endforeach; ?>
 
      <a class="ajaxLink" href="<?php echo url_for('event/index?day='.$day.'&month='.$month.'&year='.$year.'&page='.$pager->getNextPage()) ?>">
        <img src="/images/next.png" alt="Pr&oacute;xima p&aacute;gina" title="Pr&oacute;xima p&aacute;gina" />
      </a>
 
      <a class="ajaxLink" href="<?php echo url_for('event/index?day='.$day.'&month='.$month.'&year='.$year.'&page='.$pager->getLastPage()) ?>">
        <img src="/images/last.png" alt="&Uacute;ltima p&aacute;gina" title="&Uacute;ltima p&aacute;gina" />
      </a>
    </div>
    <?php endif; ?>
 
    <div class="pagination_desc">
      <strong><?php echo $pager->getNbResults() ?></strong> eventos
 
      <?php if ($pager->haveToPaginate()): ?>
        - evento <strong><?php echo $pager->getPage() ?>/<?php echo $pager->getLastPage() ?></strong>
      <?php endif; ?>
    </div>

</div>
